package com.chancingpack.dal.dao.mybatis;

import com.chancingpack.dal.dao.WxUserLoginDao;
import com.chancingpack.dal.model.WxRoleExample;
import com.chancingpack.dal.model.WxUserLogin;
import com.chancingpack.dal.model.WxUserLoginExample;
import com.chancingpack.dal.service.WxUserLoginMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/7/17.
 */
@Repository
public class WxUserLoginDaoImpl implements WxUserLoginDao {
    @Autowired
    private WxUserLoginMapper wxUserLoginMapper;

    public WxUserLogin getListByName(String username) {
        return this.wxUserLoginMapper.getListByName(username);
    }

    public List<Map<String, Object>> getSgbasCustInfo() {
        return this.wxUserLoginMapper.getSgbasCustInfo();
    }

    public List<Map<String, Object>> getRole() {
        return this.wxUserLoginMapper.getRole();
    }

    public boolean insertRecord(WxUserLogin record) {
        boolean isResult=false;
        if(this.wxUserLoginMapper.insertWxUserLogin(record)>0)
        {
            isResult=true;
        }
        return isResult;
    }

    public List<Map<String, Object>> getCheckLogin(WxUserLogin record) {
        return wxUserLoginMapper.getCheckLogin(record);
    }

    public boolean updateRecord(WxUserLogin record) {
            boolean isResult=false;
        if(this.wxUserLoginMapper.updateByPrimaryKey(record)>0)
        {
            isResult=true;
        }
        return isResult;
    }

    public List<Map<String, Object>> getListMap(Integer userloginId) {
        return this.wxUserLoginMapper.getListMap(userloginId);
    }

    public boolean deleteRecord(Integer userloginId) {
        boolean isResult=false;
        if(this.wxUserLoginMapper.deleteByPrimaryKey(userloginId)>0)
        {
            isResult=true;
        }
        return isResult;
    }

    public List<WxUserLogin> getLastRecord() {
        return this.wxUserLoginMapper.getLastRecord();
    }

    public List<Map<String, Object>> getListAllByMap(Map<String, Object> map) {
        return this.wxUserLoginMapper.getListAllByMap(map);
    }

    public List<Map<String, Object>> selectUserpage(Map<String, Object> map) {
        return this.wxUserLoginMapper.selectUserpage(map);
    }

    public int selectCount(Map<String, Object> map) {
        return this.wxUserLoginMapper.selectCount(map);
    }

    public List<Map<String, Object>> getSgbasCustInfoByCustId(String custId) {
        return this.wxUserLoginMapper.getSgbasCustInfoByCustId(custId);
    }
}
